package usb;
import java.util.Scanner;

public class Test07 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String name = "ch";
        String pwd = "123";
        while (true){
            System.out.println("请输入用户名：");
            String user = sc.nextLine();
            System.out.println("请输入密码：");
            String password = sc.nextLine();
            if (name.equals(user) && pwd.equals(password)){
                System.out.println("登录成功");
                break;
            }else{
                System.out.println("登录失败");
                System.out.println("请重新输入");
            }
        }
    }
}
